package com.raos.quartz.task;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * MyBean
 * 我的打印类
 *
 * @author raos
 * @email 991207823@qq.com
 * @date 2021/10/01 20:23
 */
@Component("myBean")
public class MyPrintBean {
	private Logger logger = LoggerFactory.getLogger(this.getClass());

	private SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

	public void printMessage() {
		// 打印当前的执行时间，格式为2019-11-01 00:00:00
		Date date = new Date();
		logger.info("LOG--MyBean Executes! Now Time is {}", sf.format(date));
		System.out.println("MyBean Executes!" + sf.format(date));
	}
}
